When a subject is photographed against light, an image of the subject becomes an ambiguous backlit image. This backlit image has such low brightness and contrast that the details thereof are difficult to discriminate. Overexposure or underexposure, blurring and out-of-focus in shooting an object, noise, or insufficient light intensity also may be cause of degradation in image quality. However, quality of such poor-quality images can be improved by executing processing on image data for enhancing the brightness and contrast thereof. Retinex processing has been known as one of such processing to improve image quality.
In Retinex processing, data of a high image quality portion is maintained, while image quality of a low image quality portion is improved. In Retinex processing, each pixel data of the original image is corrected to a value in which pixel data of surrounding pixels are reflected, using a Gaussian filter. Then, reference component data of the original image is calculated from natural logarithm of the corrected pixel data. Illuminance component data is calculated by dividing the pixel data of the original image by the pixel component of the original image. That is, the original image is divided into reference component and illuminance component. A processing, such as a gamma correction, for correcting brightness and contrast, is performed on the illuminance component. Thereafter, the corrected illuminance component and the reference component are composed to generate image data in which the low quality portion, such as a backlit image portion, has been improved in image quality in comparison to the original image.
However, in a filtering processing executed in Renetix processing, it is necessary to perform convolution operations. That is, density values of pixels of original image data are multiplied by corresponding filter coefficients to obtain products, and the sum of the products is obtained.
For example, when an image G1 shown in FIG. 1(a) is subjected to a filtering processing using a filter F1 having a scale of 9×9=81 pixels, 81 multiplications and 80 additions have to be performed. That is, a density value of each pixel in the image G1 is multiplied by a filter coefficient in the corresponding pixel of the filter F1, and the resultant products are added up. The center pixel of the filter F1 corresponds to a pixel of the image G1 subjected to the filtering processing. In this example, the filter coefficients take the values of 12 to 27.
Since the convolution operation take much time, there has been proposed to thin out rows and/or columns of elements (coefficients) in the filter F. For example, a filter F2 shown in FIG. 1(b) is created by thinning out the filter coefficients in pixels on the outermost and inner peripheries. By reducing the number of elements in this manner, the number of times of the convolution operation is reduced, thereby speeding up the filtering processing.